/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.webrx.controller;

import io.swagger.annotations.Api;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * <p>Project: javase - IndexController
 * <p>Powered by webrx On 2021-12-23 15:32:39
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
@Controller
@Api
public class IndexController {
    @GetMapping
    @ResponseBody
    public String index() {
        return "helloworld中文效果";
    }

    @GetMapping("/show")
    public void show(HttpServletResponse res) throws IOException {
        res.setContentType("text/html;charset=utf-8");
        res.setCharacterEncoding("utf-8");
        PrintWriter out = res.getWriter();
        out.printf("hello world out....中文");
    }
}
